//
//  FXCDetailViewController.m
//  Various
//
//  Created by 范新晨 on 16/3/30.
//  Copyright © 2016年 Harword. All rights reserved.
//

#import "FXCDetailViewController.h"
#import "FXCPianoModel.h"


@interface FXCDetailViewController ()

@property (nonatomic, strong) UIWebView *webView;
@end

@implementation FXCDetailViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    UIButton *backBtn = [[UIButton alloc] init];
    backBtn.frame = CGRectMake(10, 20, 30, 30);
    [backBtn setImage:[UIImage imageNamed:@"detail_icon_back_normal"] forState:UIControlStateNormal];
    backBtn.alpha = 0.7;
    [backBtn addTarget:self action:@selector(backToPiano) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:backBtn];
//    把视图显示到最上层
//    [self.view bringSubviewToFront:backBtn];
    FXCPianoModel *model = self.model;
//    NSLog(@"%@", model.content);

    
    
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 20, FXCWEIGHT, FXCHEIGHT- 69)];
//    webView.delegate = self;
    [webView loadHTMLString:model.content baseURL:nil];
    [self.view addSubview:webView];
    self.webView = webView;

    
    [webView addSubview:backBtn];
}

- (void)backToPiano{
    [self.navigationController popToRootViewControllerAnimated:YES];
    [UIApplication sharedApplication].statusBarStyle =UIStatusBarStyleLightContent;

}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
    
    
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
